package com.spodrum.balloongl;

import org.andengine.engine.handler.physics.PhysicsHandler;
import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;

public class Balloon extends Sprite 
{
	private final PhysicsHandler mPhysicsHandler;

	public Balloon(final float pX, final float pY, final float pWidth, final float pHeight, final ITextureRegion pTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager)  
	{
		super(pX, pY, pWidth, pHeight, pTextureRegion, pVertexBufferObjectManager);
		this.mPhysicsHandler = new PhysicsHandler(this);
		this.registerUpdateHandler(this.mPhysicsHandler);
		this.mPhysicsHandler.setVelocity(0, 100f);
	}
	
	public Balloon(final float pX, final float pY, final ITextureRegion pTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager)  
	{
		super(pX, pY, pTextureRegion, pVertexBufferObjectManager);
		this.mPhysicsHandler = new PhysicsHandler(this);
		this.registerUpdateHandler(this.mPhysicsHandler);
		this.mPhysicsHandler.setVelocity(0, 100f);
	}
	
	public void setVelocity(float x, float y)
	{
		this.mPhysicsHandler.setVelocity(x, y);
	}
	
	@Override
	protected void onManagedUpdate(final float pSecondsElapsed) 
	{
		super.onManagedUpdate(pSecondsElapsed);
	}

}
